// component/cereals-toast/index.js
let timer;
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        count: {
            type: String,
            value: ''
        }
    },

    /**
     * 组件的初始数据
     */
    data: {
        fadeBool: false,
        maskShow: false,
    },

    /**
     * 组件的方法列表
     */
    methods: {
        show(count) {
            let that = this;
            that._show(count)
            timer = setTimeout(function() {
                that.clear()
                clearTimeout(timer)
            }, 2000)
        },
        _show(count) {
            this.setData({
                fadeBool: true,
                maskShow: true,
                count: count
            })
        },
        clear() {
            this.setData({
                fadeBool: false,
                maskShow: false
            })
        },

    }
})